package cn.renhui.hermesbus;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import cn.renhui.hermesbus.core.Hermes;
import cn.renhui.hermesbus.utils.LogUtils;

public class MainActivity extends AppCompatActivity {

    TextView textView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        textView = findViewById(R.id.textview);

        Hermes.getDefault().init(this);
        // HermesEventBus.getDefault().register(this);
        Hermes.getDefault().register(UserManager.class);

        UserManager.getInstance().setStudent(new Student("renhui", 29));
    }

    @Override
    protected void onResume() {
        super.onResume();
        LogUtils.e("Main onResume = " + UserManager.getInstance().getStudent().name);

    }

    public void toSecond(View view) {
        startActivity(new Intent(MainActivity.this, SecondActivity.class));
    }
}